package com.spvs.system.common;

import lombok.Getter;

import java.util.Arrays;

/**
 * @description:采购状态枚举值
 * @authoer:cuizhi
 * @createDate:2024/6/23-12:26
 */

@Getter
public enum StockStateEnum {

    STOCK_IN_RENT(9, "入库"),
    STOCK_OUT_RENT(10, "出库");


    StockStateEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private Integer code;
    private String desc;

    public static StockStateEnum getByFormCode(Integer code) {
        return Arrays.stream(StockStateEnum.values())
                .filter(value -> value.getCode().equals(code))
                .findFirst().orElse(null);
    }
}
